package com.woniu.springbootshiro.mapper;

import com.woniu.springbootshiro.pojo.LampInfo;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface LampInfoMapper extends tk.mybatis.mapper.common.Mapper<LampInfo> {
  @Select("SELECT id,`check`,`name`,`type`,url,xy,low,light,oper,lampName,lampBand,insTime,A,V,`status`,`status01`,`x`,`y`,content,lampImg FROM lamp_info;")
  List<LampInfo> queryAllLamp();

  @Delete("delete from lamp_info where id=#{id}")
  int deleteOne(@Param("id") Integer id);

  //添加AlarmLight的时候将lamp_info的状态设置为可用
  @Update("update lamp_info set status01='不可用' where id=#{id}")
  int updateAlarmLight(Integer id);

  @Update("update lamp_info set status01='可用' where id=#{id}")
  int dealLampInfo(Integer id);
}
